﻿using System;
using System.Reflection;

namespace Sigil.NonGeneric
{
	public partial class Emit
	{
		/// <summary>
		/// Push a 1 onto the stack if b is true, and 0 if false.
		///
		/// Pushed values are int32s.
		/// </summary>
		public Emit LoadConstant(Boolean b)
		{
			InnerEmit.LoadConstant(b);
			return this;
		}

		/// <summary>
		/// Push a constant int32 onto the stack.
		/// </summary>
		public Emit LoadConstant(Int32 i)
		{
			InnerEmit.LoadConstant(i);
			return this;
		}

		/// <summary>
		/// Push a constant int32 onto the stack.
		/// </summary>
		public Emit LoadConstant(UInt32 i)
		{
			InnerEmit.LoadConstant(i);
			return this;
		}

		/// <summary>
		/// Push a constant int64 onto the stack.
		/// </summary>
		public Emit LoadConstant(Int64 l)
		{
			InnerEmit.LoadConstant(l);
			return this;
		}

		/// <summary>
		/// Push a constant int64 onto the stack.
		/// </summary>
		public Emit LoadConstant(UInt64 l)
		{
			InnerEmit.LoadConstant(l);
			return this;
		}

		/// <summary>
		/// Push a constant Single onto the stack.
		/// </summary>
		public Emit LoadConstant(Single f)
		{
			InnerEmit.LoadConstant(f);
			return this;
		}

		/// <summary>
		/// Push a constant Double onto the stack.
		/// </summary>
		public Emit LoadConstant(Double d)
		{
			InnerEmit.LoadConstant(d);
			return this;
		}

		/// <summary>
		/// Push a constant String onto the stack.
		/// </summary>
		public Emit LoadConstant(String str)
		{
			InnerEmit.LoadConstant(str);
			return this;
		}

		/// <summary>
		/// Push a constant RuntimeFieldHandle onto the stack.
		/// </summary>
		public Emit LoadConstant(FieldInfo field)
		{
			InnerEmit.LoadConstant(field);
			return this;
		}

		/// <summary>
		/// Push a constant RuntimeMethodHandle onto the stack.
		/// </summary>
		public Emit LoadConstant(MethodInfo method)
		{
			InnerEmit.LoadConstant(method);
			return this;
		}

		/// <summary>
		/// Push a constant RuntimeTypeHandle onto the stack.
		/// </summary>
		public Emit LoadConstant<Type>()
		{
			InnerEmit.LoadConstant<Type>();
			return this;
		}

		/// <summary>
		/// Push a constant RuntimeTypeHandle onto the stack.
		/// </summary>
		public Emit LoadConstant(Type type)
		{
			InnerEmit.LoadConstant(type);
			return this;
		}

		/// <summary>
		/// Loads a null reference onto the stack.
		/// </summary>
		public Emit LoadNull()
		{
			InnerEmit.LoadNull();
			return this;
		}
	}
}